package com.day20.Control;
public class ThreadDaemoDemo {
    public static void main(String[] args) {
        ThreadDaemo td1 = new ThreadDaemo();
        ThreadDaemo td2 = new ThreadDaemo();
        td1.setName("线程1");
        td2.setName("线程2");
        td1.start();
        td2.start();
        Thread.currentThread().setName("主线程");
        td1.setDaemon(true);
        td2.setDaemon(true);
        td1.start();
        td2.start();
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }
    }
}
